<!DOCTYPE html>
<html lang="ch">
<head>
    <meta charset="UTF-8"/>
    <title>进货渠道添加</title>
    <script type="text/javascript" src="/static/js/form-check.js"></script>
    <script type="text/javascript">
        let submitForm, channelName, price, channelWarn, priceWarn;
        window.onload = function () {
            initViews();
            bindListeners();
        };

        function initViews() {
            submitForm = document.getElementById("submitForm");
            channelName = document.getElementById("channelName");
            price = document.getElementById("price");
            channelWarn = document.getElementById("channelWarn");
            priceWarn = document.getElementById("priceWarn");
        }

        function bindListeners() {
            submitForm.onsubmit = checkForm;
        }

        function checkForm() {
            return checkNotNull(channelName, channelWarn) && checkDecimal(price, priceWarn);
        }
    </script>
</head>
<body>
<h3>销售渠道添加</h3>
<form action="/comm/addChannel.do" method="post" id="submitForm">
    <input type="hidden" name="successPage" value="${sPage!''}"/>
    <table cellpadding="5" cellspacing="0" border="1">
        <tr>
            <td>进货渠道</td>
            <td><input type="text" name="channelName" id="channelName"/><span id="channelWarn"></span></td>
        </tr>
        <tr>
            <td>利润比例</td>
            <td><input type="text" name="price" id="price"/><span id="priceWarn"></span></td>
        </tr>
    </table>
    <input type="submit" value="提交"/>
</form>
</body>
</html>